#pragma once

#include<algorithm>
#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include"create_graph.h"

using namespace std;

int vertex_to_variable(int vertex, int variables_number)
{
	if (vertex < variables_number)
		return vertex + 1;
	return variables_number - vertex - 1;
}

vector<pair<int, int> > get_expression_without_solution(int variables_number)
{
	vector<pair<int, int> > disjuncts = get_edges_for_cycle_graph(2 * variables_number);
	for (int i = 0; i < disjuncts.size(); ++i)
	{
		disjuncts[i].first = -vertex_to_variable(disjuncts[i].first, variables_number);
		disjuncts[i].second = vertex_to_variable(disjuncts[i].second, variables_number);
	}
	return disjuncts;
}

int randsgn()
{
	return 2 * (rand() % 2) - 1;
}

vector<pair<int, int> > get_expression_with_solution(int variables_number)
{
	vector<pair<int, int> > disjuncts = get_edges_for_tree_graph(variables_number);
	for (int i = 0; i < disjuncts.size(); ++i)
	{
		disjuncts[i].first = randsgn() * (disjuncts[i].first + 1);
		disjuncts[i].second = randsgn() * (disjuncts[i].second + 1);
	}
	return disjuncts;
}